//
//  XHSelectTrafficCell.m
//  umbs
//
//  Created by 冷山 on 16/6/15.
//  Copyright © 2016年 冷山. All rights reserved.
//

#import "XHSelectTrafficCell.h"

#define SCREEN_WIDTH                    ([UIScreen mainScreen].bounds.size.width)

@interface XHSelectTrafficCell()

@end

@implementation XHSelectTrafficCell

- (void)awakeFromNib {
    [super awakeFromNib];
    self.btn = [[button alloc]init];
    if (SCREEN_WIDTH==320)
    {
        self.btn.frame = CGRectMake(0, 0, 90,60);
    }
    else if(SCREEN_WIDTH==375)
    {
        self.btn.frame = CGRectMake(0, 0, 110,70);
    }
    else if (SCREEN_WIDTH>375)
    {
        self.btn.frame = CGRectMake(0, 0, 120,80);
    }
    self.btn.backgroundColor = [UIColor clearColor];
    [self.btn setBackgroundColor:[ColorManager clearColor] forState:UIControlStateNormal];
    [self.btn setBackgroundColor:[ColorManager colorWithHexString:@"#5997A4"] forState:UIControlStateHighlighted];
    [self.btn addTarget:self action:@selector(selectActions:) forControlEvents:UIControlEventTouchUpInside];
    [self addSubview:self.btn];
}

- (void)selectActions:(id)sender
{
    [_delegate cell:self selectAction:sender];
}
- (void)setSelected:(BOOL)selected{
    [super setSelected:selected];
//    if (selected==YES)
//    {
//        self.backgroundColor = [ColorManager colorWithHexString:@"5997A4"];
//        self.ui_price.textColor = [UIColor whiteColor];
//        self.ui_trafficLabel.textColor = [UIColor whiteColor];
//    }
//    else
//    {
//        self.backgroundColor = [UIColor whiteColor];
//        self.ui_price.textColor = [ColorManager colorWithHexString:@"5997A4"];
//        self.ui_trafficLabel.textColor = [ColorManager colorWithHexString:@"5997A4"];
//    }
    
    // Configure the view for the selected state
}
@end
